package com.admin.controller;


import com.common.domain.entity.Goods;
import com.common.domain.entity.ResponseResult;
import com.common.domain.entity.Volunteer;
import com.common.service.VolunteerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("system/volunteer")
public class VolunteerController {

    @Autowired
    private VolunteerService volunteerService;

    @GetMapping("list")
    public ResponseResult allVolunteerList(Integer pageNum, Integer pageSize, String name){
        return volunteerService.allVolunteerList(pageNum,pageSize,name, null);
    }

    @DeleteMapping("/{ids}")
    public ResponseResult deleteVolunteer(@PathVariable String ids){
        return volunteerService.deleteVolunteer(ids);
    }

    @PostMapping("/addVolunteer")
    public ResponseResult addVolunteer(@RequestBody Volunteer volunteer){
        return volunteerService.insertGoods(volunteer);
    }

    @PutMapping
    public ResponseResult updateVolunteer(@RequestBody Volunteer volunteer){
        return volunteerService.updateVolunteer(volunteer);
    }
}
